﻿<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <meta charset="utf-8" />
    <link href="../themes/default/easyui.css" rel="stylesheet" />
    <link href="../themes/icon.css" rel="stylesheet" />
    <script src="../scripts/jquery.min.js"></script>
    <script src="../scripts/jquery.easyui.min.js"></script>
</head>
<body>
    <table id="dg"></table>
    <div id="tb" style="margin:5px 7px 10px 7px;">
        <a id="btn" href="#" class="easyui-linkbutton add" data-options="iconCls:'icon-add'">新增</a>
        <a id="btn" href="#" class="easyui-linkbutton alter" data-options="iconCls:'icon-edit'">修改</a>
        <a id="btn" href="#" class="easyui-linkbutton del" data-options="iconCls:'icon-cut'">删除</a>
        <br />等级名称：<input type="text" />
        <a id="btn" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'">查询</a>
    </div>
    <div id="dd"  title="My Dialog" style="width:400px;height:200px;" data-options="iconCls:'icon-save',resizable:true,modal:true">
        <iframe id="frm1" frameborder="0" scrolling="no" width="99%" height="99%"></iframe>
    </div>  
    <script>
        $(function () {
            $('#dg').datagrid({
                url: '../jquery-easyui-1.4.3/demo/datagrid/datagrid_data1.json',
                method: "get",
                toolbar: "#tb",
                fitColumns: true,
                pagination: true,
                singleSelect: true,
                rownumbers: true,
                columns: [[
                     { field: 'productid', title: '等级编号', width: 150 }
                    , { field: 'productname', title: '等级名称', width: 300 }
                    , { field: 'unitcost', title: '所需最大积分', minWidth: 150 }
                    , { field: 'status', title: '扣分比例', minWidth: 160 }
                    , { field: 'listprice', title: '折扣比例', width: 160 }
                    , { field: 'attr1', title: '折扣比例', width: 160 }
                    , { field: 'itemid', title: '折扣比例', width: 160 }
                ]]
            });
            $(".add").click(function () {
                $('#dd').dialog({
                    title: 'My Dialog',
                    width: 630,
                    height: 400
                }).dialog("setTitle","新增会员卡类别").dialog("open");
                $('#frm1').attr("src", "AddVIP.html");
            })
            $(".alter").click(function () {
                $('#dd').dialog({
                    title: 'My Dialog',
                    width: 630,
                    height: 400
                }).dialog("setTitle", "修改会员卡类别").dialog("open");
                $('#frm1').attr("src", "AlterVIP.html");
            })
            $(".del").click(function () {
                $.extend($.messager.defaults, {
                    ok: "确定",
                    cancel: "取消"
                });
                $.messager.confirm('确认', '您确认想要删除记录吗？', function (r) {
                    if (r) {
                        alert('确认删除');
                    }
                }); 
            })

            //$("li a").click(function () {
            //    var src = $(this).attr("url");
            //    var titleShow = $(this).text;
            //    var strHtml = '  <iframe id="frmWork" frameborder="0" scrolling="no" width="99%" height="99%" ></iframe>';
            //    var isExist = $("#ttTab").tabs('exists', titleShow);
            //    if (!isExist)
            //    {
            //        $("ttTab").tabs("add", {
            //            title: titleShow,
            //            content: strHtml,
            //            iconCls: 'icon-ok',
            //            closable:true
            //        })
            //    } else
            //    {
            //        $('#ttTab').tabs('select', titleShow);
            //    }
            //})
        })
    </script>
</body>
</html>